#import "EchoNebulaCell.h"


@implementation EchoNebulaCell

- (instancetype)initWithFrame:(CGRect)frame {
	self = [super initWithFrame:frame];
	if (self) {
		//self.contentView.backgroundColor = UIColor.whiteColor;
	}
	return self;
}

- (void)setLantern:(EchoNebulaModel *)lantern {
	_lantern = lantern;

	//: 配置cell的UI

[self.peacefulEmbarkJewelImageView sd_setImageWithURL:[NSURL URLWithString:lantern.natural.stringValue] placeholderImage:nil];

	if (lantern.journeyZebra.count > 0) {
		[self.xenialYarnYonderImageView sd_setImageWithURL:[NSURL URLWithString:lantern.journeyZebra[0]] placeholderImage:nil];
	}

	self.wonderLabel.text = [lantern.natural stringValue];

}
//: self.elevateIntrepidButton 的点击事件
- (void)action_0 {}

- (void)reverieLayout {

    //: 描述_0
    self.elevateIntrepidButton = [[UIButton alloc] init];
    self.elevateIntrepidButton.frame = CGRectMake(15, 29, 43, 74);
    UIImage *hammerIlluminate = [UIImage imageNamed:@"images/icon_0.png"];
    if (hammerIlluminate) {
	    [self.elevateIntrepidButton setImage:hammerIlluminate forState:UIControlStateNormal];
    }
    [self.elevateIntrepidButton setTitle:@"button_0" forState:UIControlStateNormal];
    [self.elevateIntrepidButton setTitle:@"button_selected_0" forState:UIControlStateSelected];
    [self.elevateIntrepidButton setTitleColor:[UIColor colorWithRed:169/255.0 green:151/255.0 blue:78/255.0 alpha:0.6] forState:UIControlStateNormal];
    [self.elevateIntrepidButton setTitleColor:[UIColor colorWithRed:229/255.0 green:112/255.0 blue:39/255.0 alpha:0.6] forState:UIControlStateSelected];
    [self.elevateIntrepidButton addTarget:self action:@selector(action_0) forControlEvents:UIControlEventTouchUpInside];
    [self.contentView addSubview:self.elevateIntrepidButton];


    //: 描述_1
    UITextView *charismaCactusResilient = [UITextView new];
    charismaCactusResilient.size = CGSizeMake(61, 144);
    charismaCactusResilient.left = 14;
    charismaCactusResilient.top = 48;
    self.xeroxVowTextView = charismaCactusResilient;
    [self.contentView addSubview:charismaCactusResilient];


    //: 描述_2
    self.peacefulEmbarkJewelImageView = [[UIImageView alloc] initWithFrame:CGRectZero];
    self.peacefulEmbarkJewelImageView.contentMode = UIViewContentModeScaleAspectFill;
    self.peacefulEmbarkJewelImageView.clipsToBounds = YES;
    self.peacefulEmbarkJewelImageView.layer.cornerRadius = 6;
    self.peacefulEmbarkJewelImageView.layer.masksToBounds = YES;
    self.peacefulEmbarkJewelImageView.frame = CGRectMake(4, 12, 163, 66);
    UIImage *kaleidoscopeAlchemy = [UIImage imageNamed:@"images/image_2.png"];
    if (kaleidoscopeAlchemy) {
	    self.peacefulEmbarkJewelImageView.image = kaleidoscopeAlchemy;
    }
    [self.contentView addSubview:self.peacefulEmbarkJewelImageView];


    //: 描述_3
    UIView *velvetDiligentKaleidoscope = [[UIView alloc] initWithFrame:CGRectZero];
    velvetDiligentKaleidoscope.frame = CGRectMake(8, 4, 112, 157);
    self.balanceMarbleHopeView = velvetDiligentKaleidoscope;
    [self.contentView addSubview:velvetDiligentKaleidoscope];


    //: 描述_4
    self.xenialYarnYonderImageView = [[UIImageView alloc] init];
    self.xenialYarnYonderImageView.contentMode = UIViewContentModeScaleAspectFill;
    self.xenialYarnYonderImageView.clipsToBounds = YES;
    self.xenialYarnYonderImageView.layer.cornerRadius = 10;
    self.xenialYarnYonderImageView.layer.masksToBounds = YES;
    UIImage *duskLuminousIgnite = [UIImage imageNamed:@"images/image_4.png"];
    if (duskLuminousIgnite) {
	    self.xenialYarnYonderImageView.image = duskLuminousIgnite;
    }
    [self.contentView addSubview:self.xenialYarnYonderImageView];
	[self.xenialYarnYonderImageView mas_makeConstraints:^(MASConstraintMaker *make) {
		make.width.mas_equalTo(95);
		make.height.mas_equalTo(147);
	}];


    //: 描述_5
    UILabel *nebulaKindred = [[UILabel alloc] init];
    nebulaKindred.text = @"label_5";
    nebulaKindred.font = [UIFont systemFontOfSize:20 weight:UIFontWeightRegular];
    nebulaKindred.textColor = [UIColor colorWithRed:72/255.0 green:100/255.0 blue:243/255.0 alpha:0.7];
    nebulaKindred.textAlignment = NSTextAlignmentLeft;
    //: 不用理会的骚操作 = nebulaKindred.numberOfLines = 1;
    NSInteger radiantLaughter = 1;
    if (radiantLaughter>40 && radiantLaughter < 8698) {
	    radiantLaughter = 14;
	    NSString *hopefulEuphoriaUnveil = [NSString stringWithFormat:@"%ld", (long)radiantLaughter];
	    if (hopefulEuphoriaUnveil.length>18 && [hopefulEuphoriaUnveil isEqualToString:nebulaKindred.text]) {
		    radiantLaughter = hopefulEuphoriaUnveil.integerValue * 3;
	    }
    }
    nebulaKindred.numberOfLines = radiantLaughter;
    self.wonderLabel = nebulaKindred;
    [self.contentView addSubview:nebulaKindred];
	[self.wonderLabel mas_makeConstraints:^(MASConstraintMaker *make) {
		make.width.mas_equalTo(164);
		make.height.mas_equalTo(35);
		make.top.equalTo(@(23));
		make.bottom.equalTo(@(11));
	}];


    //: 描述_6
    self.fableElusiveTextField = [[UITextField alloc] initWithFrame:CGRectZero];
    [self.contentView addSubview:self.fableElusiveTextField];
	[self.fableElusiveTextField mas_makeConstraints:^(MASConstraintMaker *make) {
		make.width.mas_equalTo(93);
		make.height.mas_equalTo(158);
		make.top.equalTo(@(24));
	}];


    //: 描述_7
    UITextField *luminousDabble = [[UITextField alloc] init];
    luminousDabble.frame = CGRectMake(6, 23, 183, 82);
    self.joyousTextField = luminousDabble;
    [self.contentView addSubview:luminousDabble];
}


@end